| Conditions | 1 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | |||
| 4 | async function mpesaPayment(customer,products,amount,callback_details) { |
||
| 5 | |||
| 6 | headers = { |
||
|
|
|||
| 7 | "domain": process.env.CHPTER_CLIENT_DOMAIN, |
||
| 8 | "Authorization":"Token "+ process.env.CHPTER_TOKEN |
||
| 9 | }; |
||
| 10 | |||
| 11 | data = { |
||
| 12 | "customer_details" : customer, |
||
| 13 | "products" : products, |
||
| 14 | "amount" : amount, |
||
| 15 | "callback_details" : callback_details |
||
| 16 | }; |
||
| 17 | |||
| 18 | let res = await axios.post("https://chpter.co/api/payment/payment-initiate-callback/", data, { headers: headers}); |
||
| 19 | |||
| 20 | return res.data; |
||
| 21 | } |
||
| 22 | |||
| 57 | } |